/**
 * 百人场牛牛请求上庄列表界面
 * @author 袁安
 *
 */
class P100BankerReqListView extends how.module.Scene
{

    public btnBankerReq: how.Button;
    public scrollBankerReqUser: eui.Scroller;
    public lstBankerReqUser: eui.List;

    public constructor() 
    {
        super();
        this.skinName = "P100BankerReqListSkin"
    }

    public get resourceList(): Array<string> 
    {
        return ["public", "p100Game"];
    }

    public start(): void
    {
        this.btnBankerReq.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onReqBankerOrNot, this);
    }

    public onReqBankerOrNot(event: egret.TouchEvent): void
    {
        if (AppData.getInstance().userData.chairID != 65535)
        {
            this.report(P100BankerReqListModule.request.onReqBankerOrNot);
        }
    }

    public fillReqBankerList(data: P100GameSceneData): void
    {
        this.lstBankerReqUser.dataProvider = data.getBankerReqList();
        console.log(data.getCurrentBanker(), ">>>>>>>>>> data.getCurrentBanker():");
        console.log(AppData.getInstance().userData.chairID, ">>>>>>>>>> AppData.getInstance().userData.chairID:");
        // 如果自己还没有座位号 或者 庄家不是自己 都显示“申请上庄”
        if (AppData.getInstance().userData.chairID == 65535 || data.getCurrentBanker() != AppData.getInstance().userData.chairID)
        {
            this.btnBankerReq["btnTips"].source = "updealerBnt2_png";
        }
        else
        {
            this.btnBankerReq["btnTips"].source = "cancelApply_png";
        }
    }
}